<?php 
require_once 'include.php';
$CartPros=getAllCartPro();
$address=getAllAddress();
$total=0.00;
if(!($CartPros && is_array($CartPros))){
    alertMes("购物车中没有商品", "cart.php");
}

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>订单结算</title>
<link type="text/css" rel="stylesheet" href="styles/reset.css">
<link type="text/css" rel="stylesheet" href="styles/main.css">
	<script src="js/addFavorite.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript" src="js/ie6Fixpng.js"></script>
<![endif]-->
</head>

<body>
<div class="headerBar">
	<div class="topBar">
		<div class="comWidth">
			<div class="leftArea">
				<a href="#" onclick="AddFavorite(window.location,document.title)" class="collection" >收藏网站</a>
			</div>
			<div class="rightArea">
				欢迎来到松田淘淘乐！
				<?php if($_SESSION['loginFlag']):?>
				<span>欢迎您</span><?php echo $_SESSION['username'];?>
				<a href="doAction.php?act=userOut">[退出]</a>
				<?php else:?>
				<a href="login.php">[登录]</a><a href="reg.php">[免费注册]</a>
				<?php endif;?>
			</div>
		</div>
	</div>
	<div class="logoBar">
		<div class="comWidth">
			<div class="logo fl">
				<a href="index.php"><img src="images/logo_index.png" alt="松田淘淘乐"></a>
			</div>
			<div class="stepBox fr">
				<div class="step02"></div>
				<ul class="step_text">
					<li class="s01 active">我的购物车</li>
					<li class="s02 active">填写核对订单</li>
					<li class="s03">订单提交成功</li>
				</ul>
			</div>
		</div>
	</div>
</div>
<form action="commit.php" method="post">
<div class="shoppingCart comWidth">
	<div class="shopping_item">
		<h3 class="shopping_tit">收货地址<a href="address.php" class="backCar">添加新的收货地址</a></h3>
		<div class="shopping_cont padding_shop">
			<div class="shopping_cont pb_10">
			<div class="cart_inner">
				<div class="cart_head clearfix">
					<div class="cart_item t_name" style="width:55%">详细地址</div>
					<div class="cart_item t_price_cart" style="width:15%">收货人</div>
					<div class="cart_item t_return_cart" style="width:15%">手机号</div>
					<div class="cart_item t_operator_cart" style="width:10%">选择</div>
				</div>
				
				<?php foreach($address as $addr):?>
				<div class="cart_cont clearfix" id="addressInfo-<?php echo $addr['id']?>">
					<div class="cart_item t_name"  style="width:55%">
						<p class="cart_link" style="margin-bottom: 0px;" />
						<span><?php echo $addr['addressDetail']?></span></p>
					</div>
					<div class="cart_item t_price_cart"  style="width:15%">
						<span><?php echo $addr['consignee'];?></span></div>
					<div class="cart_item t_return_cart"  style="width:15%">
						<span><?php echo $addr['Phone'] ?></span></div>
					<div class="cart_item t_operator_cart"  style="width:10%">
						<input name="addressId" type="radio" value="<?php echo $addr['id']?>" required="required"/>
					</div>
				</div>
				<?php endforeach;?>
				
			</div>
		</div>
		</div>
	</div>
	<div class="hr_25"></div>
	<div class="shopping_item">
		<h3 class="shopping_tit">支付方式</h3>
		<div class="shopping_cont padding_shop">
			<ul class="shopping_list">         
                <select name="bdpay" id="bdpay" class="text" >
 				<option selected value="微信支付" title="微信支付">微信支付</option>
				<option value="支付宝支付" title="支付宝付款">支付宝付款</option>
                </select>  
			</ul>
		</div>
	</div>
	<div class="hr_25"></div>
	<div class="shopping_item">
		<h3 class="shopping_tit">送货清单<a href="cart.php" class="backCar">返回购物车修改</a></h3>
		<div class="shopping_cont pb_10">
			<div class="cart_inner">
				<div class="cart_head clearfix">
					<div class="cart_item t_name">商品名称</div>
					<div class="cart_item t_price">单价</div>
					<div class="cart_item t_return">返现</div>
					<div class="cart_item t_num">数量</div>
					<div class="cart_item t_subtotal">小计</div>
				</div>
				<?php foreach($CartPros as $pros):?>
				<div class="cart_cont clearfix">
					<div class="cart_item t_name">
						<div class="cart_shopInfo clearfix">
							<img src="image_350/<?php $proImgs=getProImgsById($pros['pid']);echo $proImgs[0]['albumPath'];?>" alt="">
							<div class="cart_shopInfo_cont">
								<p class="cart_link"><a href="#"><?php $proInfo=getProById($pros['pid']);echo $proInfo['pName']?></a></p>
								<p class="cart_info">微信支付微信支付微信支付微</p>
							</div>
						</div>
					</div>
					<div class="cart_item t_price"><?php echo $pros['price'] ?></div>
					<div class="cart_item t_return">无返现</div>
					<div class="cart_item t_num"><?php echo $pros['num'] ?></div>
					<div class="cart_item t_subtotal t_red">￥<?php echo $subtotal=$pros['price']*$pros['num'];$total+=$subtotal; ?></div>
				</div>
				<?php endforeach;?>
				<div class="cart_message">
					若有问题请留言，若有问题请拨打客服热线66666
				</div>
<!-- 				<div class="cart_prompt"><i class="cart_prompt_icon"></i>抱歉，一下商品无法购买。</div> -->
<!-- 				<div class="cart_cont cart_no_bor clearfix"> -->
<!-- 					<div class="cart_item t_name"> -->
<!-- 						<div class="cart_shopInfo clearfix"> -->
<!-- 							<img src="images/des_sm.jpg" alt=""> -->
<!-- 							<div class="cart_shopInfo_cont"> -->
<!-- 								<p class="cart_link"><a href="#">微信支付微信支付微信支付微</a></p> -->
<!-- 								<p class="cart_info">微信支付微信支付微信支付微</p> -->
<!-- 							</div> -->
<!-- 						</div> -->
<!-- 					</div> -->
<!-- 				</div> -->

			</div>
		</div>
	</div>
	<div class="hr_25"></div>
	<div class="shopping_item">
		<h3 class="shopping_tit">订单结算</h3>
		<div class="shopping_cont padding_shop clearfix">
			<div class="cart_count fr">
				<div class="cart_rmb">
					<i>总计：</i><span>￥<?php echo $total; ?></span>
				</div>
    				<div class="cart_btnBox">
					<input type="hidden" name="totalPrice" value="<?php echo $total; ?>">
					<input type="submit" class="cart_btn" value="提交订单">
				</div>
			</div>
		</div>
	</div>
</div>

</form>
<div class="hr_25"></div>
<?php include('footer.php');?>
</body>
</html>

<?php
